const Mock = require("mockjs");

const signIn = () => ({
  token:
    "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTUzMDMyODY2MywiaWF0IjoxNTI5NzIzODYzfQ.cgmhRgLhy8P0U2l1oLhZqHwlsetp4tUGWjxaDRjHq2uKYOKSveZikhsl_r1drbNQ8lg8ErviShknFVgo-nXg1g"
});

const queryUserAuthority = () => ({
  menus: [
    {
      menuId: 1,
      menuName: "根节点",
      menuCode: "root",
      link: "/root",
      icon: "el-icon-menu",
      lft: 1,
      rgt: 14,
      depth: 0
    },
    {
      menuId: 3,
      menuName: "应届生培训",
      menuCode: "NewTraining",
      link: "/NewTraining",
      icon: "el-icon-menu",
      lft: 4,
      rgt: 9,
      depth: 1
    },
    // {
    //   menuId: 4,
    //   menuName: "个人设定",
    //   menuCode: "profile",
    //   link: "/system/profile",
    //   icon: "el-icon-menu",
    //   lft: 5,
    //   rgt: 6,
    //   depth: 2
    // },
    {
      menuId: 5,
      menuName: "群组管理",
      menuCode: "group",
      link: "/NewTraining/group",
      icon: "el-icon-menu",
      lft: 5,
      rgt: 6,
      depth: 2
    },
    {
      menuId: 6,
      menuName: "任务管理",
      menuCode: "task",
      link: "/NewTraining/task",
      icon: "el-icon-menu",
      lft: 7,
      rgt: 8,
      depth: 2
    }
  ],
  authorities: [
    { authority_id: 1, authority_code: "AddUser", authority_name: "新增用户" },
    { authority_id: 2, authority_code: "EditUser", authority_name: "修改用户" },
    {
      authority_id: 3,
      authority_code: "DeleteUser",
      authority_name: "删除用户"
    },
    {
      authority_id: 4,
      authority_code: "QueryUser",
      authority_name: "查询用户"
    },
    {
      authority_id: 5,
      authority_code: "QueryReport",
      authority_name: "查询报告"
    }
  ]
});

const queryUser = () => ({
  total: 13,
  size: 7,
  current: 1,
  records: [
    {
      groupId: 1,
      groupName: "中关村小组1",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 12
    },
    {
      groupId: 2,
      groupName: "中关村小组2",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 12
    },
    {
      groupId: 3,
      groupName: "中关村小组3",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 12
    },
    {
      groupId: 4,
      groupName: "中关村小组4",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 12
    },
    {
      groupId: 5,
      groupName: "中关村小组5",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 12
    },
    {
      groupId: 6,
      groupName: "中关村小组6",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 12
    },
    {
      groupId: 7,
      groupName: "中关村小组7",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 32
    },
    {
      groupId: 8,
      groupName: "中关村小组8",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 12
    },
    {
      groupId: 9,
      groupName: "中关村小组9",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 12
    },
    {
      groupId: 10,
      groupName: "中关村小组10",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 12
    },
    {
      groupId: 11,
      groupName: "中关村小组1",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 12
    },
    {
      groupId: 12,
      groupName: "中关村小组1",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 12
    },
    {
      groupId: 13,
      groupName: "中关村小组1",
      groupDesc: "中关村小组描述相关的事情",
      groupUser: "张组长",
      count: 12
    }
  ],
  pages: 2
});

Mock.mock("/passport/signIn", "post", signIn);
Mock.mock("/user/queryUserAuthority", "get", queryUserAuthority);
Mock.mock("/user", "get", queryUser);
